const myObj = {
	a: 1,
	b: [1, 2, {
			c: true
		},
		[3]
	],
	d: {
		e: 2,
		f: 3
	},
	g: null,
	like: [6, 8, 9]
}

function flattenObj(obj) {
	let flatObj = {}
	for (let key1 in obj) {
		if (typeof obj[key1] == 'object' && obj[key1] !== 'null') {

		} else {
			flatObj[key] = obj[key] //flatObj={a:1}
		}
	}
	return flatObj
}

const flattenRes = flattenObj(myObj)
console.log(flattenRes);
